#pragma once
#include "tinyrpc/base/noncopyable.h"
#include <sys/epoll.h>
#include <vector> 
#include "event.h"
namespace TinyRPC{



class EPoller{

public:
    EPoller();
    void poll(std::vector<Event*>& activateChannels);
    void addEvent(EventPtr event);
    void modifyEvent(EventPtr event);
    void deleteEvent(int fd);
private:
    void fillActivateChannel(int num_activateEvents, std::vector<Event*>& activateChannels);
    void dynamicExpansion(int num_activateEvents);
private:
    int m_efd;
    std::vector<struct epoll_event> m_epollEvents; 
};
}
